<form class="layui-form layui-form-pane" action="{:url('')}" id="editForm" method="post">
    <div class="layui-form-item">
        <label class="layui-form-label">星期</label>
        <div class="layui-input-inline">
            <select name="week" class="field-week" type="select" {notempty name="id"}disabled{/notempty}>
                <option value="1">星期一</option>
                <option value="2">星期二</option>
                <option value="3">星期三</option>
                <option value="4">星期四</option>
                <option value="5">星期五</option>
                <option value="6">星期六</option>
                <option value="0">星期天</option>
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">时间段</label>
        <div class="layui-input-inline">
            <select name="period" class="field-period" type="select" {notempty name="id"}disabled{/notempty}>
                <option value="1">上午</option>
                <option value="2">下午</option>
                <option value="3">晚上</option>
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">开始时间</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input field-starttime" value="{$starttime|default=''}" name="starttime" id="starttime" readonly placeholder="请选择开始时间">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">结束时间</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input field-endtime" value="{$endtime|default=''}" name="endtime" id="endtime" readonly placeholder="请选择结束时间">
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <input type="hidden" class="field-id" name="id">
            <button type="submit" class="layui-btn layui-btn-normal" lay-submit="" lay-filter="formSubmit">提交</button>
            <a href="{:url('index')}" class="layui-btn layui-btn-primary ml10"><i class="aicon ai-fanhui"></i>返回</a>
        </div>
    </div>
</form>
{include file="admin@block/layui" /}

<script>
var formData = {:json_encode($data_info)};
/* 修改模式下需要将数据放入此变量 */
layui.use('laydate', function(){
  var laydate = layui.laydate;
  //执行一个laydate实例
  laydate.render({
    elem: '#starttime',
    type: 'time',
    format:'HH:mm:ss',
{switch name="data_info.period"}
{case value="1"}
    min:'06:00:00',
    max:'12:00:00',
{/case}
{case value="2"}
    min:'12:00:00',
    max:'18:00:00',
{/case}
{default/}
    min:'18:00:00',
    max:'24:00:00',
{/switch}
    btns: ['clear', 'confirm']
  });
  laydate.render({
    elem: '#endtime',
    type: 'time',
    format:'HH:mm:ss',
{switch name="data_info.period"}
{case value="1"}
    min:'06:00:00',
    max:'12:00:00',
{/case}
{case value="2"}
    min:'12:00:00',
    max:'18:00:00',
{/case}
{default/}
    min:'18:00:00',
    max:'24:00:00',
{/switch}
    btns: ['clear', 'confirm']
  });
});
</script>
<script src="__ADMIN_JS__/footer.js"></script>